package cn.ixiaoxin.deepchat.controller;

import cn.ixiaoxin.deepchat.service.FileUploadService;
import cn.ixiaoxin.deepchat.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class FileUploadController {

    @Autowired
    private FileUploadService fileService;

    @PostMapping("/fileUpload")
    public Result uploadFile(@RequestParam MultipartFile file) {
        return fileService.uploadFile(file);
    }

}
